home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-SPAR.{_A / ELF.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  83 lines

  1. /* $Id: elf.h,v 1.18 1998/09/09 05:36:08 davem Exp $ */
  2. #ifndef __ASM_SPARC64_ELF_H
  3. #define __ASM_SPARC64_ELF_H
  4.  
  5. /*
  6.  * ELF register definitions..
  7.  */
  8.  
  9. #include <asm/ptrace.h>
  10. #include <asm/processor.h>
  11.  
  12. /*
  13.  * These are used to set parameters in the core dumps.
  14.  */
  15. #ifndef ELF_ARCH
  16. #define ELF_ARCH        EM_SPARCV9
  17. #define ELF_CLASS        ELFCLASS64
  18. #define ELF_DATA        ELFDATA2MSB
  19.  
  20. typedef unsigned long elf_greg_t;
  21.  
  22. #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  23. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  24.  
  25. typedef struct {
  26.     unsigned long    pr_regs[32];
  27.     unsigned long    pr_fsr;
  28.     unsigned long    pr_gsr;
  29.     unsigned long    pr_fprs;
  30. } elf_fpregset_t;
  31. #endif
  32.  
  33. /*
  34.  * This is used to ensure we don't load something for the wrong architecture.
  35.  */
  36. #ifndef elf_check_arch
  37. #define elf_check_arch(x) ((x) == ELF_ARCH)    /* Might be EM_SPARCV9 or EM_SPARC */
  38. #endif
  39.  
  40. #define USE_ELF_CORE_DUMP
  41. #define ELF_EXEC_PAGESIZE    8192
  42.  
  43. /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
  44.    use of this is to invoke "./ld.so someprog" to test out a new version of
  45.    the loader.  We need to make sure that it is out of the way of the program
  46.    that it will "exec", and that there is sufficient room for the brk.  */
  47.  
  48. #ifndef ELF_ET_DYN_BASE
  49. #define ELF_ET_DYN_BASE         0x50000000000
  50. #endif
  51.  
  52.  
  53. /* This yields a mask that user programs can use to figure out what
  54.    instruction set this cpu supports.  */
  55.  
  56. /* On Ultra, we support all of the v8 capabilities. */
  57. #define ELF_HWCAP    (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
  58.              HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV | \
  59.              HWCAP_SPARC_V9)
  60.  
  61. /* This yields a string that ld.so will use to load implementation
  62.    specific libraries for optimization.  This is more specific in
  63.    intent than poking at uname or /proc/cpuinfo.  */
  64.  
  65. #define ELF_PLATFORM    (NULL)
  66.  
  67. #ifdef __KERNEL__
  68. #define SET_PERSONALITY(ex, ibcs2)                \
  69. do {                                \
  70.     if ((ex).e_ident[EI_CLASS] == ELFCLASS32)        \
  71.         current->tss.flags |= SPARC_FLAG_32BIT;        \
  72.     else                            \
  73.         current->tss.flags &= ~SPARC_FLAG_32BIT;    \
  74.                                 \
  75.     if (ibcs2)                        \
  76.         current->personality = PER_SVR4;        \
  77.     else if (current->personality != PER_LINUX32)        \
  78.         current->personality = PER_LINUX;        \
  79. } while (0)
  80. #endif
  81.  
  82. #endif /* !(__ASM_SPARC64_ELF_H) */
  83.